Sometimes when an icon is dragged and dropped in Dash, one Favourite app icon
can appear to the right of Dash separator. This can happen when available system
resources are low and the PlaceHolder destroy animation is delayed and the
corresponding container child is still present. With this commit the separator
position is calculated correctly, even when the animation is pending.
Sebastian Keller [Thu, 19 Aug 2021 18:58:31 +0000 (20:58 +0200)]
workspace: Move fading minimized windows out of allocation
eee2ccac fixed window opacity being changed outside of transitions but
resulted in the final step of the transition, that would set the window
to fully opaque, being missed.
This change now moves the opacity change entirely out of allocation and
instead follows the adjustment changes directly, which still fixes the
original bug and ensures the opacity is also applied for the last step
in the transition.
Evan Welsh [Sat, 21 Aug 2021 01:42:27 +0000 (20:42 -0500)]
init: Set console log domain
GJS added a console module that extensions may start using. To ensure that
extensions using console.log() and similar functions don't show up as
'Gjs-Console' in users' system logs, we should call setConsoleLogdomain()
with 'GNOME Shell'.
This GJS API addition is only accessible using ECMAScript Modules (ESM),
this commit moves shell startup to a small init.js module and adapts
CI jobs to either handle or ignore it.
We can drop the .jscheckignore file when future versions of SpiderMonkey
allow for compile checks without validating module specifiers.
Florian Müllner [Sun, 29 Aug 2021 12:24:42 +0000 (14:24 +0200)]
build: Add soup2 option
!1940 added support for soup 3, including a fallback to soup 2.4
where the newer version isn't available.
Unfortunately it missed that libgweather has a hidden soup dependency,
and now gnome-shell fails to start if a weather location has been set
up and soup 3 is available.
We don't have a good way to detect that case, so hide the soup 3 support
behind a build option. Distributors are expected to switch it at the
same time as libgweather.
Florian Müllner [Thu, 3 Jun 2021 18:12:35 +0000 (20:12 +0200)]
main: Stop handling old 'panel-main-menu' shortcut
It's a shortcut from the GNOME 2 days that few users will remember.
And if anyone really wants to keep it, they can use Settings to
assign <Alt>F1 to 'toggle-overview'.
Florian Müllner [Wed, 4 Aug 2021 17:37:15 +0000 (19:37 +0200)]
environment: Fallback to Soup 2.4
We cannot assume yet that Soup3 is available everywhere. Until that
is the case, allow falling back to Soup 2.4 by imitating the bits
of the Soup3 API we use with monkey-patching.
In libsoup 2.44 and later, you can set the session's “proxy-resolver”
property to the resolver returned by g_proxy_resolver_get_default() to
get the same effect. Note that for "plain" SoupSessions (ie, not
SoupSessionAsync or SoupSessionSync), this is done for you automatically.
libsoup 2.44 was released in 2013, so we can safely assume that Soup is
new enough to handle this for us.
Florian Müllner [Fri, 6 Aug 2021 22:07:30 +0000 (00:07 +0200)]
extensionDownloader: Use async code for extracting archive
The code that handles extracting extension archives currently uses
an awkward double-callback system. We can do significantly better
by using an async function and exceptions.
Florian Müllner [Thu, 12 Aug 2021 15:12:15 +0000 (17:12 +0200)]
eslint: (Mostly) synchronize configuration with gjs
In addition to the changes in this commit, gjs now
restricts the use of the Format module and initFormat.
We can't really replace those for translatable strings
until xgettext gains support for template strings, so
leave that bit out for now.
The other notable change is that gjs now requires
jsdoc comments. We can't plainly enable those options
without a massive amount of work first, but let's see
how requiring doc comments for new code goes.
Florian Müllner [Fri, 18 Jun 2021 21:15:05 +0000 (23:15 +0200)]
messageTray: Do not show low priority notifications
Low priority notifications are meant for information that doesn't require
immediate attention, so it makes sense to not show a banner for them;
they'll still appear in the notification list in the calendar.
Daniel van Vugt [Thu, 17 Sep 2020 07:25:49 +0000 (15:25 +0800)]
windowManager: Animate the appearance of new windows after overview closes
So that the animation doesn't get skipped if the overview is visible but
in the process of closing.
In this case the overview being visible also means that it is closing,
because if it's visible and not already closing then `_shouldAnimateActor`
would have returned false and exited `_mapWindow` earlier.
Daniel van Vugt [Wed, 16 Sep 2020 06:56:13 +0000 (14:56 +0800)]
workspace: Ignore new windows that appear while the overview is closing
This can easily happen if an app launches and maps a window faster than
the overview closes. We don't want the window clone appearing and then
suddenly disappearing in that case.
Daniel van Vugt [Wed, 16 Sep 2020 06:52:19 +0000 (14:52 +0800)]
overview: Add a 'closing' getter
Which better communicates what we are checking for, and is a little more
elegant than repeatedly writing:
```
Main.overview.animationInProgress && Main.overview.visibleTarget == false
```
Florian Müllner [Thu, 12 Aug 2021 00:02:12 +0000 (02:02 +0200)]
appDisplay: Replace AppIconMenu
We are finally ready to share the app menu between the top bar and
context menus in the dash/app grid. Notably that means that it is
now possible to quit an app from its context menu.
Florian Müllner [Wed, 11 Aug 2021 23:31:35 +0000 (01:31 +0200)]
appMenu: Support launching on the non-default GPU
Changing the GPU to launch an app on is the last feature from the
app context menu that is still missing. Add support for it now,
and we are ready for some unifying cleanup!
Florian Müllner [Wed, 11 Aug 2021 22:33:33 +0000 (00:33 +0200)]
appMenu: Remove separator between "new window" and actions
We hide our own "New Window" item if the app itself includes a
"new-window" action. That means that the separator between the
built-in item and desktop actions introduces a small inconsistency
depending on whether a "New Window" item is provided by the desktop
action or ourselves. There's no good reason for that from a user's
perspective, so remove the separator.
Florian Müllner [Wed, 11 Aug 2021 21:50:50 +0000 (23:50 +0200)]
appMenu: Optionally include favorites section
The context menu in the overview includes actions for managing
favorites. Add those to the AppMenu class, but make it another
option as the actions would be slightly weird in the top bar menu.
Florian Müllner [Thu, 12 Aug 2021 00:47:23 +0000 (02:47 +0200)]
appMenu: Only show 'Quit' for running apps
The top bar menu always corresponds to a running app, so it made
sense to include the 'Quit' item unconditionally. That won't be
the case for the overview context menus, so handle app state changes
and show/hide the item as necessary.
Florian Müllner [Thu, 12 Aug 2021 19:25:49 +0000 (21:25 +0200)]
appMenu: Allow showing the window section for all windows
Since commit fd0da9606fd2, we only show the "Open Windows" section
if there are at least two windows. That's another subtle difference
with the overview context menus, but while limiting the section to
a minimum of two windows makes sense where the menu always represents
a running app, it is useful to show the section even for single windows
in the dash/app grid.
Account for both uses cases by adding a corresponding option to the
constructor.
Florian Müllner [Thu, 12 Aug 2021 00:34:12 +0000 (02:34 +0200)]
appMenu: Only include non-skip-taskbar windows
There's a subtle difference between the top bar menu and the app
icon context menus in the overview regarding the "Open Window"
section.
The former includes skip-taskbar windows, the latter doesn't. It
clearly doesn't make sense for the context menu to include windows
that aren't shown in the overview, but skip-taskbar windows are
likely also less useful in the top bar menu.
Just settle on the behavior of the context menus and move on.
Florian Müllner [Wed, 11 Aug 2021 20:54:11 +0000 (22:54 +0200)]
appMenu: Hide overview when activating apps
This is the expected behavior when activating a window or app. Until
now we could rely on the menu being hidden in the overview, but as
that is about to change, make sure the menu behaves as expected.
Florian Müllner [Thu, 12 Aug 2021 00:16:59 +0000 (02:16 +0200)]
appMenu: Delay window sections update when selecting window
App windows are ordered by recency, so a focus change (correctly)
triggers the ::window-changed signal. If we rebuild the section
immediately in response, the activating item will be destroyed
before the menu's ::activate handler, with the result that the
menu remains open.
Defer the section update in that case to allow the menu to process
the ::activate signal first.
Florian Müllner [Wed, 11 Aug 2021 22:24:02 +0000 (00:24 +0200)]
appMenu: Clean up on destroy
For now the menu is only used in the top bar, where we can assume
that it exists "forever". This won't be the case when we start
reusing it elsewhere, so make sure we clean up after ourselves.
Florian Müllner [Wed, 11 Aug 2021 17:40:52 +0000 (19:40 +0200)]
appMenu: Split out from panel
There is a big overlap between the app menu in the top bar and the
context menu of app icons. It makes sense to unify the two both
from a design- and from a code perspective, so split out the more
modern one into a separate module as basis for a shared class.
screenShield: Close inhibitors that finished creation after uninhibition
There was a potential issue when suspend was inhibited and immediately
uninhibited again before the creation of the inhibitor has finished.
Then the new inhibitor would be kept active.
Sebastian Keller [Fri, 23 Jul 2021 15:35:00 +0000 (17:35 +0200)]
screenShield: Don't unnecessarily close or recreate inhibitors
ScreenShield::_syncInhibitor() was closing (and recreating) the
inhibitor everytime it was called, even if no change was needed.
This gets called in various places, including on property changes in
the login1 dbus object. These happen by the time logind already started
suspending at which point new inhibitors can no longer be created. It is
only waiting for existing inhibitors to be closed, so closing the
inhibitor without a new inhibitor will cause the suspending to proceed
immediately if no other inhibitors are present. This can also happen
before the lock screen is shown, which will then complete after resume.
Fix this by keeping track of the expected inhibition state and only
create or close inhibitors if there was a change to that.
We have initTranslations() for binding an extension's
gettext domain, but nothing to help with using gettext
from an extension.
Such help would be useful though, as an extension that
calls textdomain() like a normal application would
inadvertently changes the default domain for the whole
gnome-shell process.
Instead, extensions have to use domain-specific versions
of the gettext functions:
Make this a bit easier by adding those functions directly
to the extensions object when initTranslations() is called,
then expose helper functions for calling them.
Florian Müllner [Mon, 9 Aug 2021 02:00:43 +0000 (04:00 +0200)]
ci: Split POTFILES check between C and JS
Regex are a crude tool for analyzing whether some code *calls* a
particular function. Spidermonkey has Reflect.parse() that returns
the AST of the passed in code, which allows for a much more precise
check for javascript.
The old script is still used for C code, where i18n-affecting changes
are much rarer.
Based heavily on Philip Chimento's mozjs migration script at
https://gitlab.gnome.org/ptomato/moz60tool.
Mohammed Sadiq [Tue, 10 Aug 2021 09:52:30 +0000 (15:22 +0530)]
status/network: Use wwan settings panel for GSM/LTE Modems
GSM/UMTS/LTE modems now have better support with wwan panel in GNOME
Settings. So, if the modem supports, open wwan panel, otherwise
fallback to opening network panel when "Mobile Broadband Settings"
item is clicked.
See https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/583
Florian Müllner [Fri, 13 Aug 2021 01:09:51 +0000 (03:09 +0200)]
appDisplay: Handle null value
The value can not actually be null at that point, but it's too
hard to spot for tools like coverity:
- before setting view, we chain up to the parent's acceptDrop()
- that calls _canAccept(), which we override and check for the view
Still, and extra ? doesn't hurt, and hopefully will make the tooling
happy.
Florian Müllner [Wed, 11 Aug 2021 20:54:39 +0000 (22:54 +0200)]
status/location: Change permission table
There is now a location portal that provides a similar role
as our agent. Settings supports that portal in its application
panel, which allows users to revisit their choice later.
Unfortunately it uses a different permission store table, so
any permissions granted (or denied) through our agent won't
show up there.
To change that, switch to the same table as the portal/Settings.
Daniel van Vugt [Fri, 23 Jul 2021 09:33:43 +0000 (17:33 +0800)]
workspace: Remove skip-taskbar windows while the overview is shown
On startup desktop-icons-ng Wayland windows have skip-taskbar==FALSE so
initially pass `_isOverviewWindow` and they get added to the overview,
which is confusing to users. However almost immediately after that they
get `meta_wayland_client_hide_from_window_list` and are removed from
future overviews. So now we respond to `notify::skip-taskbar` immediately
and prevent desktop-icons-ng appearing in the startup overview too.
This is messy and ideally we'd like to know the window type immediately
on creation, but that option only exists in X11 and not Wayland.